# _*_ coding ：utf-8 _*_
# @Time : 2023/9/21 14:04
# @Author : 计科1914-02-陈鸿宇
# @File : 4.1
# @Project : 作业
class cat:
    name = ""
    tili = 0

    def __init__(self, name, tili):
        self.name = name
        self.tili = tili

    def ws(self):
        if self.tili != 0:
            self.tili -= 1
            print("小猫%s消耗1点体力，目前还剩%d点体力" % (self.name,self.tili))
        else:
            print("小猫%s没体力了。"%self.name)

    def sj(self):
        self.tili += 5
        print("小猫%s回复5点体力，目前还剩%d点体力" % (self.name, self.tili))



if __name__ == '__main__':
    cat1 = cat("花花",100)
    cat1.sj()
    cat1.ws()
    cat1.ws()